package com.why.jvm.hotspot.src.share.vm.oops;

import com.why.jvm.hotspot.src.share.vm.oops.constants.ConstantClass;
import com.why.jvm.hotspot.src.share.vm.oops.constants.ConstantUtf8Info;
import lombok.Data;

/**
 * @author xiaoTian
 * @date 2022/7/16
 * @Description:
 */
@Data
public class InterfaceInfo {

    private ConstantPool constantPool;

    /**
     * 常量池中的有效索引
     */
    private int nameIndex;

    public String getName(){
        return ((ConstantClass) constantPool.getConstantPoolMap().get(nameIndex)).getName();
    }

    @Override
    public String toString() {
        return "InterfaceInfo{" +
                "nameIndex=" + nameIndex +
                ", name=" + getName() +
                '}';
    }
}
